package com.flame.workflow.re.mapper;

import java.util.List;

import com.flame.workflow.re.controller.vo.NodeVo;
import com.flame.workflow.re.entity.Node;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * flame_workflow_re_node 流程节点定义表
 *
 * @author 吴欣童
 * @since 2023-05-04 19:55:31
 */
@Mapper
public interface NodeMapper {

    List<Node> page(NodeVo nodeVo);

    void insert(Node node);

    void updateById(Node node);

    void deleteById(@Param("modelId") Long modelId, @Param("modelVersion") Integer modelVersion,
        @Param("nodeId") Integer nodeId);

    Node findById(@Param("modelId") Long modelId, @Param("modelVersion") Integer modelVersion,
        @Param("nodeId") Integer nodeId);

    List<Node> listByModelId(@Param("modelId") Long modelId, @Param("modelVersion") Integer modelVersion);

    void deleteByModelId(@Param("modelId") Long modelId, @Param("modelVersion") Integer modelVersion);

    List<Node> findByParentId(@Param("modelId") Long modelId, @Param("modelVersion") Integer modelVersion,
        @Param("parentNodeId") Integer parentNodeId);
}